$(function () {
    let  id= getQueryString("id");
    let url = '../invite/info';
    // if (id) {
    //     url += '?parentId=' + id;
    // }
    const postData={
        parentId:id
    }
    $("#jqGrid").Grid({
        url: url,
        datatype: "json",
        autowidth:true,
        ajaxGridOptions: {
            contentType: "application/json",
        },
        mtype: "POST",
        postData:{parentId:Number(id)},
        serializeGridData: function(postData) {
            return JSON.stringify(postData);
        },
        colModel: [
            {label: 'id', name: 'id', index: 'id', key: true, hidden: true},
            {label: '订单号', name: 'orderSn', index: 'orderSn', width: 90},
            {label: '用户名', name: 'nickName', index: 'nickName', width: 80},
            {label: '订单状态', name: 'orderStatus', index: 'orderStatus', width: 80,formatter:function(cellvalue, options, rowObj){
                const dict={
                    '101':'订单已取消',
                    '102':'订单已删除',
                    '201':'订单已付款,等待发货',
                    '300':'订单已发货',
                    '301':'用户确认收货',
                    '302':'自提',
                    '401':'没有发货,退款',
                    '402':'已收'
                }
                    return dict[cellvalue]
                }},
            {label: '支付状态', name: 'payStatus', index: 'payStatus', width: 80,formatter:function(cellvalue, options, rowObj){
                    const dict={
                        '0':'未付款',
                        '1':'付款中',
                        '2':'已付款',
                        '3':'已关闭',
                        '4':'已对账',
                        '6':'未对账'
                    }
                    return dict[cellvalue]
                }},
            {label: '订单总价', name: 'orderPrice', index: 'orderPrice', width: 80},
            {label: '被邀请人电话', name: 'mobile', index: 'mobile', width: 80}]
    });

});

var vm = new Vue({
    el: '#rrapp',
    data: {
        showList: true,
        q: {

        }
    },
    methods: {
        listExport:function(){
            console.log(2234)
            exportFile('#rrapp', '../invite/export',{parentId:getQueryString("id")});
        }
    }
});